#ifndef WS2812_H
#define WS2812_H
 
#include "string.h"
#include "main.h"
#include "spi.h"

#define	WS2812_0	0xC0
#define	WS2812_1	0xF0
#define	WS2812_RST	0x00
#define RGB_BIT 24

typedef struct {
    uint16_t rgb_num;//rgb numbers
    uint8_t *buffer;// data buffer
} ws2812_t;


extern void ws2812_show_rainbow(ws2812_t *obj); // Display a rainbow effect on the WS2812 LED strip.
extern void ws2812_init(ws2812_t *obj,uint16_t rgb_num) ;// Initialize the WS2812 LED strip with the specified number of LEDs.
extern void ws2812_deinit(ws2812_t *obj) ;// Deinitialize the WS2812 LED strip and release resources.
extern void ws2812_test(ws2812_t *obj);// Perform a test on the WS2812 LED strip to check functionality.
#endif